home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_gen
/
freeli10.zip
/
SPLIT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-04-20
|
702b
|
38 lines
#include <stdio.h>
#include <string.h>
char s[160];
main(int argc, char *argv[])
{
int ctr = 0;
FILE *fp = NULL;
while(!feof(stdin))
{
gets(s);
if(s[0] == '~' && s[1] == '~' && s[2] == '~')
{
if(fp)
{
printf(" ");
if(!(ctr = (ctr + 1) % 6))
printf("&\n");
fclose(fp);
}
printf("+%s", s + 3);
strcat(s, ".ASM");
fp = fopen(s + 3, "wt");
} else {
if(fp) fprintf(fp, "%s\n", s);
}
}
if(argc > 1) printf(" &");
printf("\n");
return 0;
}